--
-- Author: shunguo.chen
-- Date: 2018-10-10 14:41:55
--
-- LotteryVo 抽奖奖品

local fileName = string.getModeName(...)
local ClassRef = class(fileName)

function ClassRef:ctor(data)
	if data then
		self:init(data)
	end
end

-- message TenRandShowLoot
-- {
-- 	pb_loot.Loot dropLoot = 1;			//实际获得的
-- 	pb_loot.Loot replaceLoot = 2;		//被替换了的奖励
-- }
function ClassRef:init(data)
	self.dropItemData = UD:parseLootToBagItem(data.dropLoot)
	if not self.dropItemData then
		self.dropItemData = UD:parseLootToBagItem({id=79999933, num=10, type="item"})
	end
	if data.replaceLoot then
		self.replaceItemData = UD:parseLootToBagItem(data.replaceLoot)
	end
end

-- 是否事坐骑
function ClassRef:getMount()
	if self.replaceItemData and self.replaceItemData.itemBagType == Enums.ItemBagType.mount then
		return self.replaceItemData, self.dropItemData
	elseif self.dropItemData.itemBagType == Enums.ItemBagType.mount then
		return self.dropItemData
	end
end

return ClassRef